package cn.tedu.micro.demo.order.controller;

import cn.tedu.micro.demo.common.protocol.JsonResult;
import cn.tedu.micro.demo.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
    @Autowired
    private OrderService orderService;
    //localhost:8100/order/create userId=1&gunId=19
    @PostMapping("/order/create")
    public JsonResult<String> create(Integer userId,Integer gunId) {
        return JsonResult.success(orderService.saveOrder(userId,gunId));
    }
}
